<template>
  <div></div>
</template>

<script lang="ts" setup>
import { watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
const route = useRoute()
const router = useRouter()
const { params, query } = route
const { path } = params
router.replace({ path: '/' + path, query })
watch(route, (value) => {
  let path1 = value.path
  if (path1.indexOf('redirect') != -1) {
    //TODO 这里为什么有BUG
    path1 = path1.slice(9)
  }
  router.replace({ path: path1, query })
})
</script>
